//
//  RentModel.m
//  RentTable
//
//  Created by xchuan xchuan on 2024/12/2.
//

#import "RentModel.h"

@implementation RentModel

- (instancetype)initWithDictionary:(NSDictionary *)dictionary {
    self = [super init];
    if (self) {
        _rentId = [dictionary[@"rentId"] integerValue];
        _rentBuyId = [dictionary[@"rentBuyId"] integerValue];
        _rentPrice = [dictionary[@"rentPrice"] floatValue];
        _rentImage = dictionary[@"rentImage"];
        _rentDetailImage = dictionary[@"rentDetailImage"];
        _rentTitle = dictionary[@"rentTitle"];
        _rentType = dictionary[@"rentType"];
        _rentDeposit = dictionary[@"rentDeposit"];
        _rentCollection = [dictionary[@"rentCollection"] boolValue];
        _rentCart = [dictionary[@"rentCart"] boolValue];
        _rentBuy  = [dictionary[@"rentBuy"] boolValue];
        _rentCondition = dictionary[@"rentCondition"];
        _rentColor = dictionary[@"rentColor"];
        _rentPeriod = [dictionary[@"rentPeriod"] integerValue];
        _rentCount = [dictionary[@"rentCount"] integerValue];
        _rentOrderNumber = dictionary[@"rentOrderNumber"];
        _rentOrderTime = dictionary[@"rentOrderTime"];
        _rentStartTime = dictionary[@"rentStartTime"];
        _rentReturnTime = dictionary[@"rentReturnTime"];
        _rentConsignee = dictionary[@"rentConsignee"];
        _rentContactInfo = dictionary[@"rentContactInfo"];
        _rentReceAddress = dictionary[@"rentReceAddress"];
    }
    return self;
}

- (NSDictionary *)toDictionary {
    return @{
        @"rentId": @(self.rentId),
        @"rentBuyId": @(self.rentBuyId),
        @"rentPrice": @(self.rentPrice),
        @"rentImage": self.rentImage,
        @"rentDetailImage":self.rentDetailImage,
        @"rentTitle": self.rentTitle,
        @"rentType": self.rentType,
        @"rentDeposit": self.rentDeposit,
        @"rentCollection": @(self.rentCollection),
        @"rentCart": @(self.rentCart),
        @"rentBuy": @(self.rentBuy),
        @"rentCondition": self.rentCondition,
        @"rentColor": self.rentColor,
        @"rentPeriod": @(self.rentPeriod),
        @"rentCount": @(self.rentCount),
        @"rentOrderNumber": self.rentOrderNumber,
        @"rentOrderTime": self.rentOrderTime,
        @"rentStartTime": self.rentStartTime,
        @"rentReturnTime": self.rentReturnTime,
        @"rentConsignee": self.rentConsignee,
        @"rentContactInfo": self.rentContactInfo,
        @"rentReceAddress": self.rentReceAddress
    };
}


@end
